<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateKdDesignersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('kd_designers', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('erp_user_id')->nullable()->comment("设计师在erp的用户id");
            $table->string('name', 24);
            $table->string('mobile', 20)->unique();
            $table->string('password')->comment('密码');
            $table->string('identity')->comment('身份证号');
            $table->string('bank')->comment('开户银行');
            $table->string('bank_account')->comment('银行账号');
            $table->string('last_login_ip')->default('')->comment('最后登录IP');
            $table->timestamp('last_login_date')->nullable(true)->comment('最后登录时间');
            $table->tinyInteger('is_ban_login')->default(0)->comment('1禁止登录,0否');
            $table->integer('login_times')->default(0)->comment('登录次数');
            $table->tinyInteger('is_register')->default(1)->comment('1不是前台注册用户,2是前台注册用户');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('kd_designers');
    }
}
